package com.sheep.demo.quartz.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Component("timerJob")
@Slf4j
public class TimerJob implements JobService {
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    @Override
    public void run(String params) {
        log.info("\n ======== \n timer-job-params:{} \n ========", params);
        log.info("time-now:{}", LocalDateTime.now().format(formatter));
    }
}
